home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
051-075
/
disk_052
/
tek4010
/
filename.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-05-06
|
2KB
|
60 lines
/****************************************************
* vt100 emulator
*
* Oct 86 TAW - removed Busy polling, & other bug fixes
* 860823 DBW - Integrated and rewrote lots of code
* v2.0 860809 DBW - Major rewrite
* v1.1 860720 DBW - Switches, 80 cols, colors, bug fixes
* v1.0 860712 DBW - First version released
*
****************************************************/
#include "vt100.h"
/*************************************************
* function to get file name
*************************************************/
void filename(name)
char name[];
{
char c;
ULONG class;
unsigned int code;
int keepgoing,i;
keepgoing = TRUE;
i=0;
while (keepgoing) {
cursoron();
Wait ( 1<< mywindow->UserPort->mp_SigBit);
while( NewMessage=(struct IntuiMessage *)GetMsg(mywindow->UserPort)){
class = NewMessage->Class;
code = NewMessage->Code;
ReplyMsg( NewMessage );
cursoroff();
if (class==RAWKEY) {
c = toasc(code,1);
if (c == 0) ;
else if (c == 13) {
name[i] = 0;
keepgoing = FALSE;
}
else if (c == 8 || c == 127) {
if (i != 0) {
i--;
emit(8);
emit(32);
emit(8);
}
}
else {
emit(c);
name[i++] = c;
}
} /* end of class == */
} /* end of GetMsg */
} /* end of keepgoing loop */
emit(13);
emit(10);
} /* end of function */